package com.star.mapper;

import com.github.pagehelper.Page;
import com.star.dto.CommentsPageQueryDTO;
import com.star.dto.PageQueryDTO;
import com.star.entity.Comments;
import com.star.vo.CommentsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CommentsMapper {
    // 评论分页查询
    Page<CommentsVO> pageQuery(CommentsPageQueryDTO commentsPageQueryDTO);

    // 新增评论
    @Insert("INSERT INTO order_comments (order_id, dish_id, setmeal_id,  user_id, comment, comment_time) " +
            "VALUES (#{orderId}, #{dishId}, #{setmealId}, #{userId}, #{comment}, #{commentTime})")
    void insert(Comments comments);
}
